From 211ce257be739447f85f17dec3a2ac604d1c8442 Mon Sep 17 00:00:00 2001 From: Ravi Sahita Date: Wed, 29 Jul 2015 09:39:22 -0700 Subject: [PATCH] x86/hvm.c: Don't tear down altp2m state if it was never set up Reported-by: Wei Liu Signed-off-by: Ravi Sahita Reviewed-by: Andrew Cooper Tested-by: Wei Liu [ ijc -- replacement subject from Andy ] --- xen/arch/x86/hvm/hvm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index ec1d797d5d..6a56216721 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -2463,7 +2463,9 @@ void hvm_vcpu_destroy(struct vcpu *v) { hvm_all_ioreq_servers_remove_vcpu(v->domain, v); - altp2m_vcpu_destroy(v); + if ( hvm_altp2m_supported() ) + altp2m_vcpu_destroy(v); + nestedhvm_vcpu_destroy(v); free_compat_arg_xlat(v); -- 2.30.2